<?php
include(dirname(__FILE__) . '/../../../bootstrap/unit.php');
require_once sfConfig::get('sf_symfony_lib_dir') . '/util/sfToolkit.class.php';
require_once sfConfig::get('sf_symfony_lib_dir') . '/yaml/sfYaml.php';

Logger::configure(dirname(__FILE__) . '/../../log4phpconfig.properties');

$configuration = ProjectConfiguration::getApplicationConfiguration( 'backend', 'test', true);

new sfDatabaseManager($configuration);
//Doctrine_Core::generateYamlFromModels(sfConfig::get('sf_root_dir'). '/config/doctrine', sfConfig::get('sf_root_dir'). '/lib/model');
//Doctrine_Core::createTablesFromModels(sfConfig::get('sf_root_dir'). '/lib/model');

//Doctrine_Core::loadData(sfConfig::get('sf_test_dir').'/unit/fixtures/doctrine');

$methodName="getActiveEmployees";
$tcount = count(1);

$t = new lime_test($tcount);
$t->diag("EmployeeTable.$methodName Tests: $tcount");

$et = Doctrine_Core::getTable('Employee');
$es = $et->getActiveEmployees();

$ic=1;
foreach ($es as $e) {
    echo  "$ic. $e (id: " . $e['id'] . ") \n";
    $ic++;
}
//echo "maxEmployeePerPage: " . sfConfig::get('app_maxEmployeePerPage') . "\n";
//echo "hiringages: " . sfConfig::get('app_hiringages') . "\n";
//$ages = sfConfig::get('app_hiringages');
//
//echo "hiringages: " . sfConfig::get('app_hiringages') . "\n";
//echo "hiringages min: " . $ages['min'] . "\n";
//echo "hiringages min: " . sfConfig::get('app_hiringagesMin') . "\n";
//echo "dir: " . sfConfig::get('sf_symfony_lib_dir') . "\n";

echo "=======================\n";
echo "====== Inactives ======\n";
$ic=1;
$es = $et->getInactiveEmployees();
foreach ($es as $e) {
    echo  "$ic. $e (id: " . $e['id'] . ") \n";
    $ic++;
}
echo "==========================\n";
echo "====== Active x PP 1======\n";
$ic=1;
$pp1 =Doctrine_Core::getTable('PayPeriod')->find(1);
$es = $et->getActiveEmployeesForPayPeriod($pp1);
foreach ($es as $e) {
    echo  "$ic. $e (id: " . $e['id'] . ") \n";
    $ic++;
}
echo "==========================\n";
echo "====== Active x PP 2======\n";
$ic=1;
$pp1 =Doctrine_Core::getTable('PayPeriod')->find(2);
$es = $et->getActiveEmployeesForPayPeriod($pp1);
foreach ($es as $e) {
    echo  "$ic. $e (id: " . $e['id'] . ") \n";
    $ic++;
}
echo "==========================\n";
echo "====== Active x PP 7======\n";
$ic=1;
$pp1 =Doctrine_Core::getTable('PayPeriod')->find(7);
$es = $et->getActiveEmployeesForPayPeriod($pp1);
foreach ($es as $e) {
    echo  "$ic. $e (id: " . $e['id'] . ") \n";
    $ic++;
}
//foreach ($testCases[$methodName] as $case) {
//    $t->is($sc->classify($case['input']),
//            $case['output'], $case['comment']);
//}
?>
